import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/api/article/list',
    method: 'get',
    params: query
  })
}

export function exportArticle() {
  return request({
    url: '/api/article/export',
    method: 'post',
    responseType: 'blob'
  })
}

export function fetchArticle(id) {
  return request({
    url: '/api/article/detail',
    method: 'get',
    params: { id }
  })
}

export function setStatus(data) {
  return request({
    url: '/api/article/status',
    method: 'post',
    data
  })
}

export function createArticle(data) {
  return request({
    url: '/api/article/create',
    method: 'post',
    data
  })
}

export function deleteArticle(data) {
  return request({
    url: '/api/article/delete',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/api/article/update',
    method: 'post',
    data
  })
}
